import Vue from 'vue'
import Router from 'vue-router'
import { Layout, Content } from "@/components"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'content',
      component: Content,
      redirect: '/home',
      children: [{
        path: '/home',
        name: 'home',
        component: () => import('@/views/home')
      }, {
          path: 'business',
          name: 'business',
          component: Layout,
          children: [{
            path: 'list', 
            name: 'list',
            component: () => import('@/views/business/list.vue')
          }, {
            path: 'shop',
            name: 'shop',
            component: () => import('@/views/business/shop.vue')
          }, {
            path: 'setting',
            name: 'setting',
            component: () => import('@/views/business/setting.vue')
          // }, {
          //   path: 'clerk',
          //   name: 'clerk',
          //   component: () => import('@/views/business/clerk.vue')
          }]
      }, {
        path: 'user',
        name: 'user',
        component: Layout,
        children: [{
        path: 'list',
        name: 'list',
        component: () => import('@/views/user/list')
        }]
      }, {
        path: 'system',
        name: 'system',
        component: Layout,
        children: [{
          path: 'role',
          name: 'role',
          component: () => import('@/views/system/role')
        }, {
          path: 'user',
          name: 'user',
          component: () => import('@/views/system/user')
        }]
      }]
    }, {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login')
    }
  ]
})
